// src/router/album.js
const Router = require("koa-router");
const { save, list, detail, delete: delteAlbum, saveCategory,
  listCategory,
  detailCategory,
  deleteCategory,
  savePhoto,
  getPhotoList,
  deletePhoto
} = require("@/controller/album");
const auth = require("@/middleware/auth");

const router = new Router({ prefix: "/album" });

router.post("/save", auth, save);       // 创建
router.post("/list", list);         // 列表
router.get("/:id", detail);    // 详情
router.post("/delete", auth, delteAlbum); // 删除

// 分类路由
router.post("/category/save", auth, saveCategory);       // 创建
router.post("/category/list", listCategory);         // 列表
router.get("/category/:id", detailCategory);    // 详情
router.post("/category/delete", auth, deleteCategory); // 删除

// 照片路由
router.post("/photo/add", auth,savePhoto);       // 创建
router.post("/photo/list", getPhotoList);         // 列表
router.post("/photo/delete", auth, deletePhoto); // 删除

module.exports = router;